﻿//  --------------------------------
//  Copyright (c) 2010 Michael Schuler, Sascha Burger. All rights reserved.
//  This source code is made available under the terms of the Microsoft Public License (Ms-PL)
//  http://p2pmessaging.codeplex.com/license
//  ---------------------------------
using System;
using System.Collections.Generic;

namespace p2pMessaging.Interfaces
{
	/// <summary>
	/// Interface for the different plugins to send and receive messages.
	/// </summary>
	public interface IMessageService : IDisposable
	{
		/// <summary>
		/// Gets the id of the plugin.
		/// </summary>
		Guid PluginId { get; }
		
		/// <summary>
		/// Send a message.
		/// </summary>
		/// <param name="message">Message to send.</param>
		void Send(IMessage message);
		
		/// <summary>
		/// Return all received messages.
		/// </summary>
		/// <returns>All received messages. List can be empty.</returns>
		List<IMessage> Receive();
	}
}
